package com.lwq.controller;

import com.lwq.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2021/11/12
 */
@RestController
public class TestController {

    @Autowired
    private RedisUtil redisUtil;

    @GetMapping(value = "/test/redis")
    public void testRedis() {
        redisUtil.put("aaaa", "123456",1L, TimeUnit.MINUTES);
    }

    @GetMapping(value="/test/redis2")
    public void testRedis2(){
        redisUtil.put("aaa","123456",5L,TimeUnit.MINUTES);
    }
}
